﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class HomePanel : UIBase
{
    public GameObject go;
    Button scanning_btn;

    void Awake()
    {
        scanning_btn = transform.Find("scanning_btn").GetComponent<Button>();
        scanning_btn.onClick.AddListener(OnScanningOnClick);
    }

    void OnScanningOnClick()
    {
        OnLoginFun();
        UIManager.Instance.Open<ArPanel>();        
        UIManager.Instance.Close<HomePanel>();
    }

    public override void OnClose(params object[] args)
    {
        
    }

    void OnLoginFun()
    {
        //登录
        Island.PBAccount pb = new Island.PBAccount();
        pb.id = Util.UUID;
        pb.sex = Random.Range(0, 2);
        NetworkManager.Instance.Send(Protocol.ReqLogin, pb);
    }
}
